package ClassLoader;

/**
 * @Author shangchao
 * @Date 2020/9/26 15:04
 */
public class GetSystemClassLoader {
    public static void main(String[] args) {
        ClassLoader cl = ClassLoader.getSystemClassLoader();
        try{
            Class<?> cls = cl.loadClass("java.util.ArrayList");
            //实际上ArrayList类是由Bootstrap Loader加载的
            ClassLoader actualLoader = cls.getClassLoader();
            System.out.println(actualLoader);
        }catch (ClassNotFoundException e){
            e.printStackTrace();
        }
    }
}
